package ru.paswd.marketprice.data.mappers

import ru.paswd.marketprice.api.dto.Shop
import ru.paswd.marketprice.data.models.LatLng

object ShopMapper {
    fun fromDto(shop: Shop?) = ru.paswd.marketprice.data.models.Shop(
        shop?.id,
        shop?.name,
        shop?.imageHref,
        shop?.address,
        if (shop?.lat != null && shop.lng != null)
            LatLng(shop.lat!!, shop.lng!!)
        else
            null
    )
}